/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.applicatioN.entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Asus_k53s
 */
@Entity
@Table(name = "bureau", catalog = "database", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Bureau.findAll", query = "SELECT b FROM Bureau b"),
    @NamedQuery(name = "Bureau.findByPays", query = "SELECT b FROM Bureau b WHERE b.pays = :pays"),
    @NamedQuery(name = "Bureau.findByAdresse", query = "SELECT b FROM Bureau b WHERE b.adresse = :adresse"),
    @NamedQuery(name = "Bureau.findByTel", query = "SELECT b FROM Bureau b WHERE b.tel = :tel"),
    @NamedQuery(name = "Bureau.findByEmail", query = "SELECT b FROM Bureau b WHERE b.email = :email"),
    @NamedQuery(name = "Bureau.findBySiteWeb", query = "SELECT b FROM Bureau b WHERE b.siteWeb = :siteWeb"),
    @NamedQuery(name = "Bureau.findByDateDOuverture", query = "SELECT b FROM Bureau b WHERE b.dateDOuverture = :dateDOuverture")})
public class Bureau implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "PAYS")
    private String pays;
    @Basic(optional = false)
    @Column(name = "ADRESSE")
    private String adresse;
    @Basic(optional = false)
    @Column(name = "TEL")
    private int tel;
    @Basic(optional = false)
    @Column(name = "EMAIL")
    private String email;
    @Basic(optional = false)
    @Column(name = "SITE_WEB")
    private String siteWeb;
    @Basic(optional = false)
    @Column(name = "DATE_D_OUVERTURE")
    @Temporal(TemporalType.DATE)
    private Date dateDOuverture;
    @OneToMany(mappedBy = "nationalite")
    private Collection<Candidat> candidatCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pays")
    private Collection<Agent> agentCollection;

    public Bureau() {
    }

    public Bureau(String pays) {
        this.pays = pays;
    }

    public Bureau(String pays, String adresse, int tel, String email, String siteWeb, Date dateDOuverture) {
        this.pays = pays;
        this.adresse = adresse;
        this.tel = tel;
        this.email = email;
        this.siteWeb = siteWeb;
        this.dateDOuverture = dateDOuverture;
    }

    public String getPays() {
        return pays;
    }

    public void setPays(String pays) {
        this.pays = pays;
    }

    public String getAdresse() {
        return adresse;
    }

    public void setAdresse(String adresse) {
        this.adresse = adresse;
    }

    public int getTel() {
        return tel;
    }

    public void setTel(int tel) {
        this.tel = tel;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getSiteWeb() {
        return siteWeb;
    }

    public void setSiteWeb(String siteWeb) {
        this.siteWeb = siteWeb;
    }

    public Date getDateDOuverture() {
        return dateDOuverture;
    }

    public void setDateDOuverture(Date dateDOuverture) {
        this.dateDOuverture = dateDOuverture;
    }

    @XmlTransient
    public Collection<Candidat> getCandidatCollection() {
        return candidatCollection;
    }

    public void setCandidatCollection(Collection<Candidat> candidatCollection) {
        this.candidatCollection = candidatCollection;
    }

    @XmlTransient
    public Collection<Agent> getAgentCollection() {
        return agentCollection;
    }

    public void setAgentCollection(Collection<Agent> agentCollection) {
        this.agentCollection = agentCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pays != null ? pays.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Bureau)) {
            return false;
        }
        Bureau other = (Bureau) object;
        if ((this.pays == null && other.pays != null) || (this.pays != null && !this.pays.equals(other.pays))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.applicatioN.entities.Bureau[ pays=" + pays + " ]";
    }
    
}
